feat(accesscontrol): add external setRoleAdmin and grantRoleBatch/rev…#156
Merged
adamgall merged 4 commits intoOct 31, 2025
Merged
Conversation
Contributor
Coverage Report
Last updated: Fri, 31 Oct 2025 14:01:24 GMT for commit |
Contributor
Gas ReportComparing gas usage between Summary
Details
Showing top 20 changes out of 41 total. View all 41 changes
ℹ️ About this reportThis report compares gas usage between the base branch and this PR using
To run this locally: # Generate snapshot for current branch
forge snapshot
# Compare with another branch
git checkout main
forge snapshot --diff .gas-snapshotLast updated: Fri, 31 Oct 2025 14:01:47 GMT for commit |
adamgall
suggested changes
Oct 30, 2025
JackieXu
pushed a commit
to JackieXu/Compose
that referenced
this pull request
Nov 6, 2025
…control-phase1-core feat(accesscontrol): add external setRoleAdmin and grantRoleBatch/rev…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…okeRoleBatch
Summary
Adds Phase 1 usability improvements to
AccessControlFacet: an externalsetRoleAdminwith admin auth, plusgrantRoleBatchandrevokeRoleBatchfor efficient DAO-scale role management. This enables dynamic role hierarchy updates and multi-address role operations in a single transaction.Changes Made
AccessControlFacet
setRoleAdmin(bytes32 _role, bytes32 _adminRole)with current-admin authorization andRoleAdminChangedevent.grantRoleBatch(bytes32 _role, address[] calldata _accounts)with admin authorization and per-accountRoleGrantedevents.revokeRoleBatch(bytes32 _role, address[] calldata _accounts)with admin authorization and per-accountRoleRevokedevents.Tests
setRoleAdminsuccess/revert paths.Checklist
Before submitting this PR, please ensure:
[ x] Code follows the Solidity feature ban - No inheritance, constructors, modifiers, public/private variables, external library functions,
using fordirectives, orselfdestruct[x ] Code follows Design Principles - Readable, uses diamond storage, favors composition over inheritance
[x ] Code matches the codebase style - Consistent formatting, documentation, and patterns (e.g. ERC20Facet.sol)
[x ] Code is formatted with
forge fmt[ x] Tests are included - All new functionality has comprehensive tests
[ x] All tests pass - Run
forge testand ensure everything works[ x] Documentation updated - If applicable, update relevant documentation
Additional Notes
DEFAULT_ADMIN_ROLEremains initial admin for new roles.setRoleAdminenables controlled migration to custom hierarchies.